    /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication1.uno;

/**
 *
 * @author abelitro
 */
public class TestParse {

    public static void parse(String str) {
        float f = 0;
        try {
             f = Float.parseFloat(str);
        } catch (NumberFormatException nfe) {
            f = 0;
        } finally {
            System.out.println(f);
        }
    }

    public static void main(String[] args) {
        parse("invalid");
    }
}
